import re

data = """
*********************
valid acc: 88.762, test acc: 89.600, test flops: 17.20M
*********************
valid acc: 88.902, test acc: 89.750, test flops: 18.73M
*********************
valid acc: 89.002, test acc: 89.980, test flops: 20.29M
*********************
valid acc: 89.243, test acc: 90.210, test flops: 22.17M
*********************
valid acc: 89.603, test acc: 90.470, test flops: 24.06M
*********************
valid acc: 89.944, test acc: 90.580, test flops: 26.42M
*********************
valid acc: 90.345, test acc: 91.010, test flops: 29.13M
*********************
valid acc: 90.465, test acc: 91.230, test flops: 31.86M
*********************
valid acc: 90.505, test acc: 91.260, test flops: 35.78M
*********************
valid acc: 90.585, test acc: 91.150, test flops: 39.51M
*********************
valid acc: 90.605, test acc: 91.260, test flops: 44.45M
*********************
valid acc: 90.925, test acc: 91.490, test flops: 49.84M
*********************
valid acc: 91.026, test acc: 91.880, test flops: 55.77M
*********************
valid acc: 91.186, test acc: 91.940, test flops: 63.24M
*********************
valid acc: 91.086, test acc: 91.990, test flops: 71.19M
*********************
valid acc: 90.946, test acc: 91.780, test flops: 79.79M
*********************
valid acc: 90.825, test acc: 91.650, test flops: 89.70M
*********************
valid acc: 90.705, test acc: 91.490, test flops: 98.75M
*********************
valid acc: 90.745, test acc: 91.410, test flops: 109.02M
*********************
valid acc: 90.765, test acc: 91.400, test flops: 118.94M
*********************
valid acc: 90.765, test acc: 91.480, test flops: 128.21M
*********************
valid acc: 90.845, test acc: 91.530, test flops: 136.92M
*********************
valid acc: 90.865, test acc: 91.600, test flops: 144.90M
*********************
valid acc: 90.885, test acc: 91.640, test flops: 152.62M
*********************
valid acc: 90.925, test acc: 91.630, test flops: 159.76M
*********************
valid acc: 90.925, test acc: 91.620, test flops: 166.12M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 172.32M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 178.12M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 183.88M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 189.13M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 193.69M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 198.06M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 201.83M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 205.44M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 209.01M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 212.40M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 215.61M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 218.35M
*********************
valid acc: 90.946, test acc: 91.620, test flops: 221.11M

"""

# 正则表达式，用于匹配 "test acc" 和 "test flops" 后面的浮点数
regex = r"test acc: ([\d.]+), test flops: ([\d.]+)"

# 查找所有匹配项
matches = re.findall(regex, data)

# 遍历所有匹配项并以指定格式输出
for match in matches:
    test_acc = match[0]
    test_flops = match[1]
    print(f"{test_flops}e6,{test_acc}")
